/**
 * Project Name:bfs
 * File Name:GeneralCategory.java
 * Package Name:com.zeei.dsas.vo
 * Date:2016年9月28日下午2:17:44
 * Copyright (c) 2016, ZEEI All Rights Reserved. *
 *
 * ClassName:GeneralCategory
 * Function: TODO ADD FUNCTION.
 * @author   chq
 * @since    JDK 1.8
 */

package com.zeei.ems.base.vo;

import com.github.pagehelper.PageHelper;
import com.zeei.ems.base.constant.GlobalConstant;
import com.zeei.ems.base.tree.TreeNodeVO;


public class GeneralCategoryVO extends TreeNodeVO<GeneralCategoryVO> {
	/**
	 * serialVersionUID:TODO(用一句话描述这个变量表示什么).
	 *
	 * @since JDK 1.8
	 */
	//private static final long serialVersionUID = 1L;

	private int page = 1;
	private int rows = 20;
	// 通用码
	private String generalCode;
	// 通用名
	private String generalName;
	// 类别分类
	private String categoryClass;
	// 分类中文名
	private String categoryName;
	// 状态
	private Integer cstatus;
	// 备注
	private String remark;
	// 排序
	private Integer orderNum;
	// 父级编码
	private String pCode;

	public int getPage() {
		return page;
	}

	public int getRows() {
		return rows;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public void setRows(int rows) {
		this.rows = rows;
	}

	public String getGeneralCode() {
		return generalCode;

	}

	public void setGeneralCode(String generalCode) {
		this.generalCode = generalCode == null ? null : generalCode.trim();
		this.id = generalCode;
	}

	public String getCategoryName() {
		return categoryName;
	}

	public void setCategoryName(String categoryName) {
		this.categoryName = categoryName == null ? null : categoryName.trim();
		this.text = categoryName;
	}

	public String getCategoryClass() {
		return categoryClass;
	}

	public void setCategoryClass(String categoryClass) {
		this.categoryClass = categoryClass;
	}

	public String getGeneralName() {
		return generalName;
	}

	public void setGeneralName(String generalName) {
		this.generalName = generalName;
	}

	public Integer getCstatus() {
		return cstatus;
	}

	public void setCstatus(Integer cstatus) {
		this.cstatus = cstatus;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Override
	public Integer getOrderNum() {
		return orderNum;
	}

	@Override
	public void setOrderNum(Integer orderNum) {
		this.orderNum = orderNum;
	}

	public String getpCode() {
		return pCode;
	}

	public void setpCode(String pCode) {
		this.pCode = pCode == null ? null : pCode.trim();
		this.parentId = pCode;
	}

	public void setPageInfo(int page, int rows) {
		this.page = page;
		this.rows = rows;

		// 设置全局的分页信息,mybatis 使用到
		int pageNum = this.page < 1 ? GlobalConstant.DEFAULT_PAGENUM : this.page;
		int pageSize = this.rows < 1 ? GlobalConstant.DEFAULT_PAGESIZE : this.rows;
		PageHelper.startPage(pageNum, pageSize);
	}

	@Override
	public String toString() {
		return "GeneralCategory [generalCode=" + generalCode + ", generalName=" + generalName + ", categoryClass="
				+ categoryClass + ", categoryName=" + categoryName + "]";
	}
}